<template>
  <el-backtop
    v-bind="$attrs"
    :right="right"
    v-on="$listeners"
  >
    <template v-if="$slots.default">
      <slot />
    </template>
    <template v-else>
      <i class="el-icon-caret-top" />
    </template>
  </el-backtop>
</template>

<script>
import Vue from 'vue';
import {Backtop, Icon} from "element-ui";
Vue.use(Backtop);
Vue.use(Icon);
/**
 * 回到页面顶部
 * @author maolin
 */
export default {
  name: 'EaBacktop',
  props: {
    /**
     * 到页面右侧的距离,单位是像素
     * @public
     */
    right: {
      type: Number,
      default: 20
    }
  }
};
</script>

<style scoped>

</style>
